<?
/**
* Copyright (c) 2002-2007 BioWare Corp.
* http://www.bigdaddymonitor.org
*
* This file is part of the BigDaddy Monitoring
* program. It is free software distributed under
* the terms of the BSD License. It is ditributed
* in the hopes that it will be useful, but
* WITHOUT ANY WARRANTY; without event the implied
* warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE.
*
* The BSD License is available from:
* http://www.opensource.org/licenses/bsd-license.php
**/
$_SESSION["sessdata"]["pagefrom"]=$_SERVER["QUERY_STRING"];

?>



<form name="catform" >
<div class="orgbar" align="left">

<span class="text">

<?

$pn=$_REQUEST["pn"];

if ($pn==0 || !isset($pn) || $pn=="") {
        $pn=1;
}

$max_num=30; //Max Number to show on a page
$sn=($pn-1)*$max_num;

	$aCriteria = array(
		"active" => -1,
		"start_number" => $sn,
		"max_results" => $max_num
		);

$aServerGroups = $BigDaddyData->GetReportGroups($aCriteria);

$num_pages=ceil($aServerGroups["nTotalRows"]/$max_num);

//Start Number
$pstr="<b>Pages:</b> ";

for ($p=1;$p<=$num_pages;$p++) 
{
        if ($p==$pn) 
		{
                $pstr.="<b>".$p."</b> ";
        } 
		else 
		{
                $pstr.="<a href=\"index.html?page=ReportGroupIndex&pn=".$p."\">".$p."</a> ";
        }
}


?>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?=$pstr;?>
</span>
</div>

<style>
.lineitem#problem
{
	background-color: #ffcc99;
}
</style>

<table border="0" cellpadding="0" cellspacing="0" width="97%">

<?



if (!is_array($aServerGroups["aResults"]))
{
?>
	<tr valign="middle">
	<td class="lineitem">
	<div align="center"><b>No reporting groups match your criteria</b></div>
	</td>
	</tr>
<?
}
else
{
	foreach ($aServerGroups["aResults"] as $nIndex => $row)
	{
		$BigDaddyDisplay->ShowReportGroupLine($row);
	}
}
?>

</table>
</form>
</div>
